C_SRC=$(wildcard *.c)
OBJS=$(C_SRC:.c=.o)
DEPS=$(wildcard *.h)
CC=i486-mingw32-gcc
CFLAGS=-Wall
LDFLAGS=-lm
BINARY=Schweissroboter

.PHONY: all
all: schweissroboter

schweissroboter: $(OBJS)
	$(CC) $(LDFLAGS) -o $(BINARY) $(OBJS)

$(OBJS): %.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

depends.mk: $(C_SRC) $(DEPS)
	$(CC) -MM $(C_SRC) > depends.mk

include depends.mk

.PHONY: clean
clean:
	-@rm -vf *.o depends.mk $(BINARY) *~
